<script>
export default {
  name: 'Modal',
  props: {
    type: {
      type: String,
      default: ''
    },
    title: {
      type: String,
      default: ''
    }
  },
  functional: true,
  render (h, context) {
    const props = context.props
    const renderTitle = () => {
      return (
        <span slot="title" class="title">
          {props.title}
        </span>
      )
    }
    return (
      <el-dialog
        custom-class="modal"
        center
        destroy-on-close>
        {renderTitle()}
        {context.children}
        <span slot="footer" class="dialog-footer">
          <el-button size="small">取 消</el-button>
          <el-button size="small" type="primary">确 定</el-button>
        </span>
      </el-dialog>
    )
  }
}
</script>
